﻿namespace Stickam_Client
{
    public __gc class RoomlistClass
    {
        // Methods
        public: void __gc* add(Object __gc* name, Object __gc* id, Object __gc* population, Object __gc* created, Object __gc* isPrivate, Object __gc* isProtected, Object __gc* isFlagged)
        {
            this->ArrayRoomCreated = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomCreated), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomFlagged = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomFlagged), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomID = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomID), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomName = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomName), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomPopulation = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomPopulation), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomPrivate = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomPrivate), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomProtected = *static_cast<__box String __gc* __gc []*>(Utils::CopyArray(*static_cast<__box Array*>(this->ArrayRoomProtected), __gc new String __gc*[(this->total + 1)]));
            this->ArrayRoomCreated[this->total] = Conversions::ToString(created);
            this->ArrayRoomFlagged[this->total] = Conversions::ToString(isFlagged);
            this->ArrayRoomID[this->total] = Conversions::ToString(id);
            this->ArrayRoomName[this->total] = Conversions::ToString(name);
            this->ArrayRoomPopulation[this->total] = Conversions::ToString(population);
            this->ArrayRoomPrivate[this->total] = Conversions::ToString(isPrivate);
            this->ArrayRoomProtected[this->total] = Conversions::ToString(isProtected);
            this->total++;
        }

        public: void __gc* clear()
        {
            this->ArrayRoomCreated = __gc new String __gc*[1];
            this->ArrayRoomFlagged = __gc new String __gc*[1];
            this->ArrayRoomID = __gc new String __gc*[1];
            this->ArrayRoomName = __gc new String __gc*[1];
            this->ArrayRoomPopulation = __gc new String __gc*[1];
            this->ArrayRoomPrivate = __gc new String __gc*[1];
            this->ArrayRoomProtected = __gc new String __gc*[1];
            this->total = 0;
        }

        public: Int32 __gc* getIndex(String __gc* roomID)
        {
            return Array::IndexOf<String __gc*>(this->ArrayRoomID, roomID);
        }

        public: String __gc* getParam(Int32 __gc* index, Int32 __gc* paramType)
        {
            Int32 __gc* num = paramType;
            if (num == this->created)
            {
                return this->ArrayRoomCreated[index];
            }
            if (num == this->id)
            {
                return this->ArrayRoomID[index];
            }
            if (num == this->isFlagged)
            {
                return this->ArrayRoomFlagged[index];
            }
            if (num == this->isPrivate)
            {
                return this->ArrayRoomPrivate[index];
            }
            if (num == this->isProtected)
            {
                return this->ArrayRoomProtected[index];
            }
            if (num == this->name)
            {
                return this->ArrayRoomName[index];
            }
            if (num == this->population)
            {
                return this->ArrayRoomPopulation[index];
            }
            return S"";
        }


        // Fields
        public: String __gc* ArrayRoomCreated __gc [];
        public: String __gc* ArrayRoomFlagged __gc [];
        public: String __gc* ArrayRoomID __gc [];
        public: String __gc* ArrayRoomName __gc [];
        public: String __gc* ArrayRoomPopulation __gc [];
        public: String __gc* ArrayRoomPrivate __gc [];
        public: String __gc* ArrayRoomProtected __gc [];
        public: Int32 __gc* created = 0;
        public: Int32 __gc* id = 1;
        public: Int32 __gc* isFlagged = 2;
        public: Int32 __gc* isPrivate = 3;
        public: Int32 __gc* isProtected = 4;
        public: Int32 __gc* name = 5;
        public: Int32 __gc* population = 6;
        public: Int32 __gc* selectedIndex = -1;
        public: Int32 __gc* total;
    };
}

